package com.cays.myresearch.entity;


import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Random;

public class Teacher extends Person{
  private long students;
  private long classes;
  private String type;
  private String organization;
  private String instruction;

  public String getInstruction() {
    return instruction;
  }

  public void setInstruction(String instruction) {
    this.instruction = instruction;
  }
  public Teacher() {
  }

  public Teacher(String name, long students, long classes, String type, String organization,
                 String instruction) {
    SimpleDateFormat format=new SimpleDateFormat("yy-MM-dd HH:mm:ss");
    this.time=format.format(new Date ());
    this.students = students;
    this.classes = classes;
    this.type = type;
    this.organization = organization;
    this.instruction=instruction;
  }
  public String getTime() {
    return time;
  }

  public void setTime(String time) {
    this.time = time;
  }


  public long getStudents() {
    return students;
  }

  public void setStudents(long students) {
    this.students = students;
  }


  public long getClasses() {
    return classes;
  }

  public void setClasses(long classes) {
    this.classes = classes;
  }


  public String getType() {
    return type;
  }

  public void setType(String type) {
    this.type = type;
  }


  public String getOrganization() {
    return organization;
  }

  public void setOrganization(String organization) {
    this.organization = organization;
  }

  public Classes issueClass(String title,String instruction,String teacher,String type,double price){
    SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");//设置日期格式
    String date=df.format(new Date());// new Date()为获取当前系统时间
    Random ra=new Random();
    int time=ra.nextInt(200)+50;
    Classes classes=new Classes(name,title,teacher,instruction,""+time+"分钟",type,price,date);
    return classes;
  }
  public boolean editClass(){
    SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");//设置日期格式
    String time=df.format(new Date());// new Date()为获取当前系统时间
    return false;
  }
  public boolean deleteClass(){
    SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");//设置日期格式
    String time=df.format(new Date());// new Date()为获取当前系统时间
    return false;
  }
  @Override
  public String toString() {
    return "(students, classes, type, organization, instruction, name" +
            ", nick, password, time) values (?,?,?,?,?,?,?,?,?)";
  }
}
